/**
 * @author khathirdstep1025.
 * 16/05/2013.
 * Copyright (c) 2013 - 2014.
 */

package com.kha;

/**
 * Java bean for data model Trainee.
 * @author khathirdstep1025.
 *
 */
public class Trainee {

	// Constants.
	static final String EMPTY = "";
	
	// Fields.
	private String _account;
	private String _firstname;
	private String _lastname;
	private String _email;

	// Get, set methods.
	public String getAccount() {
		return _account;
	}

	public void setAccount(String _account) {
		this._account = _account;
	}

	public String getFirstname() {
		return _firstname;
	}

	public void setFirstname(String _firstname) {
		this._firstname = _firstname;
	}

	public String getLastname() {
		return _lastname;
	}

	public void setLastname(String _lastname) {
		this._lastname = _lastname;
	}

	public String getEmail() {
		return _email;
	}

	public void setEmail(String _email) {
		this._email = _email;
	}

	/**
	 * Check the validity of a trainee info.
	 * 
	 * @return True or False
	 */
	public Boolean isValid() {

		if (_account == null || EMPTY.equals(_account)) {
			return false;
		}

		if (_firstname == null || EMPTY.equals(_firstname)) {
			return false;
		}

		if (_lastname == null || EMPTY.equals(_lastname)) {
			return false;
		}

		if (_email == null || EMPTY.equals(_email)) {
			return false;
		}

		return true;
	}

}
